home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Lib / test / test_opcodes.py < prev    next >
Encoding:
Python Source  |  1992-05-06  |  390 b   |  24 lines  |  [TEXT/R*ch]

  1. # Python test set -- part 2, opcodes
  2.  
  3. from test_support import *
  4.  
  5.  
  6. print '2. Opcodes'
  7. print 'XXX Not yet fully implemented'
  8.  
  9. print '2.1 try inside for loop'
  10. n = 0
  11. for i in range(10):
  12.     n = n+i
  13.     try: 1/0
  14.     except NameError: pass
  15.     except ZeroDivisionError: pass
  16.     except TypeError: pass
  17.     try: pass
  18.     except: pass
  19.     try: pass
  20.     finally: pass
  21.     n = n+i
  22. if n <> 90:
  23.     raise TestFailed, 'try inside for'
  24.